/**
 * @param {string} s
 * @return {boolean}
 */
var isValid = function (s) {
    let tamp = ['()', '[]', '{}'];
    let stack = [];
    if(s.length%2 == 0){

        for (let i = 0; i < s.length; i++) {
            if (stack.length > 0) {
                if ((tamp.indexOf(stack[stack.length - 1] + s.charAt(i)))!=-1) stack.pop()
                else stack.push(s.charAt(i))
            }
            else stack.push(s[i])
        }
        return stack.length > 0 ? false : true;
    }
    else return false
};


const leftToRight = {
    "(":")",
    "[":"]",
    "{":"}"
}
var isVaild = function(s){
    const stack = []
    const len = s.length
    if(!s){

    }
}
console.log(isValid("([])"))